<%@ include file="header.jsp" %>

<script type="text/javascript">
$(document).ready(function() { 
    // call the tablesorter plugin 
    $("table").tablesorter({ 
        // sort on the first column and third column, order asc 
        sortList: [[0,0],[2,0]],
        headers: { 1: { sorter: false}, 3: {sorter: false}, 4: {sorter: false} }
    }); 
});
</script>
			<div class="conten_dcha">
			<h3>Companies directory
			</h3>	
			
				 <table class="lst_practices tablesorter" cellspacing="1" summary="<fmt:message key='company.list.table.title'/>">
                  <caption>
                    <fmt:message key='company.list.table.title'/>
                  </caption>
			      <thead>
                    <tr>
                      <th scope="col" ><fmt:message key='company.list.table.header.company'/></th>
                      <th scope="col"><fmt:message key='company.list.table.header.video'/></th>
                      <th scope="col"><fmt:message key='company.list.table.header.goodpractice'/></th>
					  <th scope="col"><fmt:message key='company.list.table.header.validate.status'/></th>
					  <th scope="col"><fmt:message key='company.list.table.header.link'/></th>
                    </tr>
                  </thead>
                  <tbody>
                    <c:forEach items="${companies}" var="company">
                  		<tr>
                  		<td scope="row" class="first">${company.companyInfo.name}<span>${company.companyInfo.city} (${company.companyInfo.country})</span> </td>
                      	<td  class="second">                 	
                      	<c:if test="${!empty company.videos}">
								<c:set var="video" value="${company.videos[0]}"/>
								<a href="<c:url value='/dashboard/detail/${company.id}'/>" title="${company.companyInfo.name}">
									<img src="${video.thumbURL}" alt="${company.companyInfo.name}" />
                      				<span><img src="<c:url value='/static/img/interfaz/play_naranja_mini.png'/>" alt="<fmt:message key='action.video.play'/>"></span>
                      			</a>
	 						</c:if> 
                      
                      </td>
                      <td class="third">
                      	<p>${company.additionalInformation.title}</p> 
                      </td>
                      <td class="four">
                      	<c:choose>
							<c:when test="${!company.validated}">	
								<img src="/static/img/interfaz/no_valida.png" alt="Not <fmt:message key='company.list.table.header.validate.status'/>" title="Not <fmt:message key='company.list.table.header.validate.status'/>"/>
							</c:when>
							<c:otherwise>
								<img src="/static/img/interfaz/valida.png" alt="<fmt:message key='company.list.table.header.validate.status'/>" title="<fmt:message key='company.list.table.header.validate.status'/>" />
							</c:otherwise>	
						</c:choose>
                      		
                      	</td>
                      	<td class="four">
                      		<a href="<c:url value='/dashboard/detail/${company.id}'/>" 
                      			title="Detail of ${company.companyInfo.name} company">
                      		<img src="/static/img/interfaz/application_go.png" 
                      			alt="${company.companyInfo.name} company" title="${company.companyInfo.name} company" />
                      		</a>	
                      	</td>
                      	
                      </tr>
                  	</c:forEach>   
                  </tbody>
                </table>
               
			</div>
<%@ include file="footer.jsp" %>